<template>
  <div>
    <el-button @click="showDialog1"> js调用弹框</el-button>
    <el-button @click="showDialog2"> 标签渲染弹框</el-button>

    <MyDialog
      :openModify="openModify"
      @handClose="handClose"
      @handlEmit="handlEmit"
    ></MyDialog>
  </div>
</template>
<script>
import MyDialog from "./compoment/model/index.vue";
export default {
  components: { MyDialog },
  data() {
    return {
      openModify: false,
      isOpen: false,
    };
  },
  methods: {
    showDialog1() {
      this.$model({ title: "提示", content: "你好啦" })
        .then((res) => {
          console.log("开启：", res);
        })
        .catch((err) => {
          console.log("关闭：", err);
        });
    },

    handClose(flag) {
      this.openModify = flag;
      console.log("取消");
    },
    handlEmit(flag) {
      this.openModify = flag;
      console.log("做确认处理");
    },
    showDialog2() {
      this.isOpen = true;
      this.openModify = true;
    },
  },
};
</script>